#ifndef _PUBLIC_H__
#define _PUBLIC_H__
#include <map>
#include <unordered_map>

static const int LARGE_BUF_LEN=1024;
static const int MEDIAN_BUF_LEN =512;
static const int SMALL_BUF_LEN=128;
enum COLOR_NUMBER
{
    DEFAULT_COLOR=0,
    INFO_COLOR = 36,
    ERROR_COLOR= 35,
    DEBUG_COLOR= 32,
    FATAL_COLOR= 33,
    LINE_CLOLOR,
    FUNCTIONAL_COLOR,
    FILE_COLOR,
};
enum LOG_LEVEL
{
    INFO =0,
    ERROR,
    DEBUG,
    FATAL
};
enum LOG_FILD
{
    LINE_NUMBER=0,
    FUNCTION_NAME,
    FILE_NAME
};

static std::unordered_map<LOG_LEVEL,COLOR_NUMBER> LogLevelColor={
    {INFO,INFO_COLOR},
    {ERROR,ERROR_COLOR},
    {DEBUG,DEBUG_COLOR},
    {FATAL,FATAL_COLOR}
};

static std::unordered_map<LOG_FILD,COLOR_NUMBER> LogFeildColor={
    {LINE_NUMBER,INFO_COLOR},
    {FUNCTION_NAME,ERROR_COLOR},
    {FILE_NAME,DEBUG_COLOR},
};

static std::unordered_map<LOG_LEVEL,std::string> LogLevelTypeString={
    {INFO,"[INFO]"},
    {ERROR, "[ERROR]"},
    {DEBUG,"[DEBUG]"},
    {FATAL,"[FATAL]"}
};

static std::unordered_map<std::string,LOG_LEVEL> LogLevelType={
    {"INFO",INFO},
    { "ERROR",ERROR},
    {"DEBUG",DEBUG},
    {"FATAL",FATAL}
};


enum BIZTYPE
{
    LOGIN=0,
    REGISTER,
};
#endif